import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/watch",
  },
  //路由的重定向意思是打开的时候在根目录的时候路径会自动跳转到/watch
  {
    path: "/watch",
    name: "watch",
    component: () => import("../views/Watch.vue"),
  },
  {
    path: "/computed",
    name: "computed",
    component: () => import("../views/Computed.vue"),
  },
];

const router = new VueRouter({
  routes,
});

export default router;
